package com.zfzs.post.modules.post.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;
import java.util.List;

/**
* @author ck
* @date 2019-09-27
*/
@Entity
@Data
@Table(name="post_terminal_info")
public class TerminalInfo implements Serializable {

    // 主键
    @Id
    @Column(name = "id")
    private Long id;

    // 所属代理商id
    @Column(name = "agent_id")
    private Long agentId;

    // sn号
    @Column(name = "sn")
    private String sn;

    // 唯一编号
    @Column(name = "numbers")
    private String numbers;

    // 所属终端类型id
    @Column(name = "terminal_type_id")
    private Long terminalTypeId;

    // 0: 正常 1：禁用 
    @Column(name = "status")
    private Long status;

    // 所属渠道 0 为总平台 所有的渠道都会有
    @Column(name = "channel_id")
    private Long channelId;

    // 是否激活 0：否 1：是
    @Column(name = "is_activation")
    private Long isActivation;

    // 是否报备 0：否 1：是
    @Column(name = "is_report")
    private Long isReport;

    // 创建日期
    @Column(name = "create_time")
    private Timestamp createTime;

    // 是否删除 
    @Column(name = "del_flag")
    private Long delFlag;

    // 修改时间
    @Column(name = "update_time")
    private Timestamp updateTime;

    @Column(name = "create_date")
    private Timestamp createDate;

    @Column(name = "activation_date")
    private Timestamp activationDate;

    public void copy(TerminalInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}